from typing import Any, AsyncGenerator

from databases import Database

from core.config import settings

# 创建数据库实例
DATABASE_URL = settings.DATABASE_URL

database = Database(DATABASE_URL)


async def get_db() -> AsyncGenerator[Database, Any]:
    """数据库依赖"""
    yield database
